//
//  CWSportSportingViewController.m
//  China_Walk
//
//  Created by HYY on 16/10/21.
//  Copyright © 2016年 qishuolei. All rights reserved.
//

#import "CWSportSportingViewController.h"
#import "CWSportMapViewController.h"

@interface CWSportSportingViewController ()

@end

@implementation CWSportSportingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor magentaColor];
    [self setupMapVC];
    
}

-(void)setupMapVC{
//    1 实例化地图控制器
    CWSportMapViewController *map = [[CWSportMapViewController alloc]init];
//    2 添加控制器到当前控制器
    [self addChildViewController:map];
//    3 子视图添加到当前视图
    [self.view addSubview:map.view];
    map.view.frame = self.view.bounds;
//    设置运动轨迹
    map.tracking = [[CWSportTracking alloc]initWithType:_type];
//    4 完成控制器的添加
    [map didMoveToParentViewController:self];
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
